package com.network;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: sun.hongliang
 * @create: 2018/08/29 17:23
 */
@Controller
public class HelloDemo {
    @RequestMapping("/hello")
    public @ResponseBody
    String test() {
        System.out.println("hello");
        User user = new User();
        user.setAge(12);
        user.setName("name");
        return "{'name':'eee'}";
    }
}

class User {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
